package com.luych.toolbox.common.feign.view.data.service;

import com.luych.toolbox.common.enums.DataBackupPlanStatus;
import com.luych.toolbox.common.feign.FeignView;
import com.luych.toolbox.common.feign.view.base.service.UserView;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

@ApiModel("数据备份计划")
public class DataBackupPlanView extends FeignView {

    @ApiModelProperty("数据源")
    private DataSourceView dataSource;
    @ApiModelProperty("数据代理")
    private DataAgentView dataAgent;
    @ApiModelProperty("描述")
    private String name;
    @ApiModelProperty("备份文件前缀")
    private String file;
    @ApiModelProperty("CRON表达式")
    private String cron;
    @ApiModelProperty("状态")
    private DataBackupPlanStatus status;
    @ApiModelProperty("责任人")
    private UserView owner;

    public DataSourceView getDataSource() {
        return dataSource;
    }

    public String getDataSourceId() {
        return dataSource == null ? null : dataSource.getId();
    }

    public void setDataSource(DataSourceView dataSource) {
        this.dataSource = dataSource;
    }

    public DataAgentView getDataAgent() {
        return dataAgent;
    }

    public String getDataAgentId() {
        return dataAgent == null ? null : dataAgent.getId();
    }

    public void setDataAgent(DataAgentView dataAgent) {
        this.dataAgent = dataAgent;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getFile() {
        return file;
    }

    public void setFile(String file) {
        this.file = file;
    }

    public String getCron() {
        return cron;
    }

    public void setCron(String cron) {
        this.cron = cron;
    }

    public DataBackupPlanStatus getStatus() {
        return status;
    }

    public void setStatus(DataBackupPlanStatus status) {
        this.status = status;
    }

    public String getStatusValue() {
        return status == null ? null : status.getValue();
    }

    public UserView getOwner() {
        return owner;
    }

    public void setOwner(UserView owner) {
        this.owner = owner;
    }

    public String getOwnerId() {
        return owner == null ? null : owner.getId();
    }
}
